package com.sky.controller.user;

import com.sky.entity.Dish;
import com.sky.result.Result;
import com.sky.service.UserDishService;
import com.sky.vo.DishItemVO;
import com.sky.vo.DishVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zcf
 */
@RestController("userDishController")
@RequestMapping("/user/dish")
@Api(tags = "用户端菜品接口")
public class DishController {


    @Resource
    private UserDishService userDishService;
    /**
     * 根据分类id查询菜品
     *
     */
    @GetMapping("/list")
    @ApiOperation("根据分类id查询菜品")
    public Result<List<DishVO>> getByCategoryId(Long categoryId) {
    List<DishVO> list= userDishService.list(categoryId);
      return Result.success(list);
    }
}
